<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateTeamFoundsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('team_founds', function (Blueprint $table) {
            $table->increments('id');
            $table->integer('user_id');
            $table->integer('order_id');                           // 开团的订单id
            $table->integer('team_activity_id');
            $table->string('status', 20)->default('UNPAID'); //UNPAID PAID SUCCESS FAIL
            $table->timestamp('ended_at')->nullable();
            $table->integer('needer')->default(2);                 //开团需要的人数
            $table->integer('join')->default(0);                    //已参与人数
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('team_founds');
    }
}
